#!/usr/bin/env python2
#

import krakenex

k = krakenex.API()
k.load_key('kraken.key')

def showBalance():
    KRA_balance = k.query_private('Balance')
    ktoEUR = KRA_balance['result']['ZEUR']
    ktoBTC = KRA_balance['result']['XXBT']
    ktoLTC = KRA_balance['result']['XLTC']
    print "Kto: EUR=",ktoEUR, "BTC=",ktoBTC, "LTC=",ktoLTC

showBalance()
#BitCoin 2 LiteCoin
bitcoin2ltc = k.query_public('Ticker', {'pair':'XXBTXLTC'})
print "KRA sell 1 BTC for",bitcoin2ltc['result']['XXBTXLTC']['a'][0], "LTC"
print "KRA buy  1 BTC for",bitcoin2ltc['result']['XXBTXLTC']['b'][0], "LTC"


#k.query_private('AddOrder', {'pair': 'XXBTZEUR',
#                            'type': 'buy',
#                             'ordertype': 'limit',
#                             'price': '100',
#                            'volume': '0.01'
#                             })


#k.query_private('AddOrder', {'pair': 'XXBTZEUR',
#                           'type': 'sell',
#                             'ordertype': 'limit',
#                             'price': '700',
#                            'volume': '0.01'                            
#                             })
